package com.cn.study007;

import java.util.Scanner;

/**
 * @author lw
 * @ClassName Test70020.java
 * @Description
 * @createTime 2023年05月14日 17:52:00
 */
public class Test70020 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入菱形的行数：");
        int t=sc.nextInt();
        if (t%2==0){
            System.out.print("请输入奇数：");
            t=sc.nextInt();
        }
        int n=(t/2)+1;
        for (int i = 1; i <= n; i++) {
            for (int k = 1; k <=n-i ; k++) {
                System.out.print(" ");
            }
            for (int j = 1; j <= 2*i-1 ; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
        for (int i = n-1; i >0; i--) {
            for (int k = 1; k <=n-i ; k++) {
                System.out.print(" ");
            }
            for (int j = 1; j <= 2*i-1 ; j++) {
                System.out.print("*");
            }
            System.out.println();
        }

    }
}
